//
//  UIImage+YSExtension.h
//  YSKitExample
//
//  Created by Kyson on 2017/6/16.
//  Copyright © 2017年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (YSExtension)

#pragma mark - 圆角
/*
 * 圆角: #import "UIImage+YSRounderCorners.h"
 */

#pragma mark - 色彩 & 水印

/**
 * 添加水印文字
 */
- (UIImage *)ys_watermarkImage:(NSString *)text;

/**
 * 添加水印图片
 */
- (UIImage *)ys_imageWithWaterMask:(UIImage*)mask inRect:(CGRect)rect;

/**
 *  修改image的大小
 */
- (UIImage *)ys_imageByScalingToSize:(CGSize)targetSize;

/**
 *  控件截屏
 */
+ (UIImage *)ys_imageWithCaputureView:(UIView *)view;

/**
 *  拉伸图片不变形
 */
- (UIImage *)ys_stretchImage;

/// 返回原图
- (UIImage *)ys_original;

/**
 *  通过路径加载图片
 */
+ (UIImage *)ys_imageWithPathName:(NSString *)name type:(NSString *)type;
+ (UIImage *)ys_imageWithFileName:(NSString *)fileName;

/**
 *  对图片进行滤镜处理
 */
- (UIImage *)ys_filterWithFilterName:(NSString *)name;

/**
 *  对图片进行模糊处理
 */
- (UIImage *)ys_blurWithBlurName:(NSString *)name radius:(NSInteger)radius;

/**
 *  调整图片饱和度, 亮度, 对比度
 *
 *  @param saturation 饱和度
 *  @param brightness 亮度: -1.0 ~ 1.0
 *  @param contrast   对比度
 *
 */
- (UIImage *)ys_colorControlsWithSaturation:(CGFloat)saturation
                                 brightness:(CGFloat)brightness
                                   contrast:(CGFloat)contrast;

/// 获取视频某个时间的帧图片
+ (UIImage *)ys_thumbnailImageForVideo:(NSURL *)videoURL atTime:(NSTimeInterval)time;

@end
